package com.luoxiang.socialandroid.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.luoxiang.socialandroid.R;
import com.luoxiang.socialandroid.base.BaseActivity;
import com.luoxiang.socialandroid.utils.MmkvUtil;

public class AuditStatusActivity extends BaseActivity {
    private ImageView im_status, icon_back;
    private TextView tx_status, bt_status, textHint;

    @Override
    protected void initListener() {
        icon_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        bt_status.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (bt_status.getText().toString().equals(getString(R.string.mi_close))) {
                    finish();
                } else {
                    Intent intent = new Intent(AuditStatusActivity.this, RealAuditActivity.class);
                    startActivity(intent);
                    finish();
                }
            }
        });
    }

    @Override
    protected void initLayout(Bundle savedInstanceState) {
        setContentView(R.layout.activity_auditstatus);
        setStatusBarTranslucent();
    }

    @Override
    protected void initView() {
        im_status = findViewById(R.id.im_status);
        icon_back = findViewById(R.id.icon_back);
        tx_status = findViewById(R.id.tx_status);
        bt_status = findViewById(R.id.bt_status);
        textHint = findViewById(R.id.textHint);
        textHint.setText("请添加微信："+MmkvUtil.INSTANCE.decodeString("help_information"));
        Intent intent = getIntent();
        int status = intent.getIntExtra("status", -1);
        if (status == 0) {
            im_status.setImageResource(R.mipmap.icon_audit_shenhezhong);
            tx_status.setText(R.string.mi_ziliaoshenhezhong);
            bt_status.setText(R.string.mi_close);
        } else if (status == 1) {
            im_status.setImageResource(R.mipmap.icon_audit_yitongguo);
            tx_status.setText(R.string.mi_shimingrenzhengtongguo);
            bt_status.setText(R.string.mi_close);
        } else if (status == 2) {
            im_status.setImageResource(R.mipmap.icon_audit_weitongguo);
            tx_status.setText(R.string.mi_shimingrenzhengshibai);
            bt_status.setText(R.string.mi_chongxinrenzheng);
        }
    }
}
